package com.example.computer_exam_training_sys.service.impl;

import com.example.computer_exam_training_sys.mapper.QuestionCommentsVOMapper;
import com.example.computer_exam_training_sys.service.QuestionCommentVOService;
import com.example.computer_exam_training_sys.vo.QuestionCommentDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionCommentVOServiceImpl implements QuestionCommentVOService {

    @Autowired
    private QuestionCommentsVOMapper questionCommentsVOMapper;

    @Override
    public List<QuestionCommentDTO> getAllComments() {
        return questionCommentsVOMapper.findAllComments();
    }

    @Override
    public QuestionCommentDTO getCommentById(Integer commentId) {
        return questionCommentsVOMapper.findByCommentId(commentId);
    }

    @Override
    public int deleteCommentById(Integer commentId) {
        return questionCommentsVOMapper.deleteByCommentId(commentId);
    }
}
